#include<stdio.h>

int main()
{
	int num;
	scanf("%x", &num);
	printf("%d", num);
	
	return 0;
}


